{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>添加</h5>
        </div>
        <div class="ibox-content">
            <form class="layui-form" action="" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">目的地</label>
                    <div class="layui-input-block" style="margin-left: 114px">
                        <input value="" required type="text" name="address" lay-verify="title" autocomplete="off" placeholder="请输入目的地" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">类型</label>
                    <div class="layui-input-block" style="margin-left: 114px">
                        <select name="type" lay-filter="aihao">
                            <option value="1">景点</option>
                            <option value="2">基础建筑</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item key">
                    <label class="layui-form-label" style="width:143px;">景点、或基础建筑</label>
                    <span class="add" style="color: #0a6aa1;cursor:pointer;">添加</span>
                    <div class="layui-input-block ee" style="width: 200px;">
                        <input required type="text" name="key[]" lay-verify="title" autocomplete="off" placeholder="请输入" class="layui-input">
                        <span class="del" onclick="shanchu()" style="color: red;cursor:pointer;">删除</span>
                    </div>

                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>

{include file="public/footer" /}
<script>
    //添加景点
    $('.add').click(function () {
        var str = '<div class="layui-input-block ee" style="width: 200px;">\n' +
                    '<input required type="text" name="key[]" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">\n' +
                    ' <span data-id="1" onclick="shanchu(this)" class="del" style="color: red;cursor:pointer;">删除</span>\n' +
                    '</div>';
        $('.key').append(str);
        $('.del').click(function () {
            $(this).parent('.ee').remove();
        });
    });
    $('.del').click(function () {
        $(this).parent('.ee').remove();
    });


</script>


</body>
</html>